import 'package:flutter_test/flutter_test.dart';
import 'package:lrc/lrc.dart';

const s1 = '''
[al:新概念英语（二）]
[ar:MP3 同步字幕版（美音）]
[ti:A Private Conversation]
[00:02.77]  
[00:09.77]Why did the writer complain to the people behind him?
[00:15.91]Last week I went to the theatre.
[00:19.39]I had a very good seat.
[00:22.07]The play was very interesting.
[00:25.10]I did not enjoy it.
[00:27.43]A young man and a young woman were sitting behind me.
[00:31.96]They were talking loudly.
[00:34.59]I got very angry.
[00:37.41]I could not hear the actors.
[00:40.64]I turned round.
[00:42.80]I looked at the man and the woman angrily.
[00:47.27]They did not pay any attention.
[00:50.69]In the end, I could not bear it.
[00:54.98]I turned round again.
[00:57.75]'I can't hear a word!' I said angrily.
[01:03.45]'It's none of your business,'
[01:06.27]the young man said rudely.
[01:09.00]'This is a private conversation!'
''';

void parseLrc() async {
  var parsedLrc = Lrc.parse(s1);
  for (var line in parsedLrc.lyrics) {
    if (line.lyrics.trim().isEmpty) continue;
    print('${line.timestamp.toString()}: ${line.lyrics}');
  }
}

void main() {
  testWidgets('lrc parser', (WidgetTester tester) async {
    parseLrc();
  });
}
